<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/login.css">
    <script src="js/jquery-3.5.1.min.js"></script>
    <title>Document</title>
</head>

<body>
    <div class="header" id="head">
        <div class="title">用户登录</div>

    </div>

<div class="wrap" id="wrap">
    <div class="logGet">

        <div class="logD logDtip">
            <p class="p1">登录 </p>
        </div>
        <div class="lgD">
            <input type="text" placeholder="请输入用户名" name="userAccount" id="userAccount" value="" />
            <span></span>
        </div>
        <div class="lgD">
            <input type="password" placeholder="请输入密码" name="userPwd" id="userPwd" />
            <span></span>
        </div>
        <div class="logC">
            <a id="loginButton"><button>欢迎您的登录</button></a>
        </div>
        <div class="zc">
            <a href="register.html">我要注册</a>
        </div>
    </div>
</div>

    </div>

    </div>
    </div>
    <script>
        $(function(){
            $("#loginButton").click(function(){
                // 获取输入的用户名
                var user = $("#userAccount").val();
                // 获取输入的密码
                var pwd = $("#userPwd").val();

                if(user == 'admin' && pwd =='123456'){
                    alert('登录成功');
                    location.href='home.html';
                }else{
                    alert('用户名或密码错误');
                }
            })
        })
    </script>
</body>

</html>